#include<bits/stdc++.h>
using namespace std;
int solve() {
  int a,b;
  cin>>a>>b;
  if(a>2*b || b>2*a || (a+b)%3!=0) cout << "NO\n";
  else cout << "YES\n";
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
  int tc;cin>>tc;
  for(int t = 1; t <= tc; t++) {
    solve();
  }
  return 0;
}
